package com.example.controller;

import com.example.pojo.dto.WorkExperienceDTO;
import com.example.pojo.entity.WorkExperience;
import com.example.service.WorkExperienceService;
import com.example.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 本文来演示
 *
 * @author 赵建云
 * @create 2023/10/31
 */
@RestController
@RequestMapping("workExperience")
public class WorkExperienceController {
    @Autowired
    private WorkExperienceService workExperienceService;
    @PostMapping("findWorkExperience")
    public Result findWorkExperience(Integer jsId){
        List<WorkExperience> list = workExperienceService.findWorkExperience(jsId);
        return new Result(200,"工作经历查询成功",list);
    }
    @PostMapping("saveOrUpdateWorkExperience")
    public Result saveOrUpdateWorkExperience(WorkExperienceDTO workExperienceDTO){
        int count = workExperienceService.saveOrUpdateWorkExperience(workExperienceDTO);
        return new Result(200,"保存或更新成功");
    }
}
